var t = require;
var e = module;
var o = exports;
var _n,
    i =
        (this && this.__extends) ||
        ((_n = function n(t, e) {
            return (_n =
                Object.setPrototypeOf ||
                ({ __proto__: [] } instanceof Array &&
                    function (t, e) {
                        t.__proto__ = e;
                    }) ||
                function (t, e) {
                    for (var o in e) {
                        Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                    }
                })(t, e);
        }),
            function (t, e) {
                function o() {
                    this.constructor = t;
                }
                _n(t, e), (t.prototype = null === e ? Object.create(e) : ((o.prototype = e.prototype), new o()));
            }),
    s =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var i,
                s = arguments.length,
                r = s < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if (
                "object" == (typeof Reflect === "undefined" ? "undefined" : typeof Reflect) &&
                "function" == typeof Reflect.decorate
            )
                r = Reflect.decorate(t, e, o, n);
            else
                for (var c = t.length - 1; c >= 0; c--) {
                    (i = t[c]) && (r = (s < 3 ? i(r) : s > 3 ? i(e, o, r) : i(e, o)) || r);
                }
            return s > 3 && r && Object.defineProperty(e, o, r), r;
        };
Object.defineProperty(o, "__esModule", { value: !0 });
var r = cc._decorator,
    c = r.ccclass,
    a = r.property,
    u = t("BaseUI"),
    l = t("UIEnum"),
    d = t("UIManager"),
    p = t("SDK"),
    h = (function (t) {
        function e() {
            var e = (null !== t && t.apply(this, arguments)) || this;
            return (
                (e.childNode = null),
                (e.enterBtn = null),
                (e.cancelBtn = null),
                (e.tipsLabel = null),
                (e.game = null),
                (e.enterBack = null),
                e
            );
        }
        return (
            i(e, t),
            (e.prototype.onLoad = function () {
                var t = this;
                this.enterBtn.on(
                    cc.Node.EventType.TOUCH_END,
                    function (e) {
                        t.hide(), t.enterBack && t.enterBack(), e.stopPropagation();
                    },
                    this
                ),
                    this.cancelBtn.on(
                        cc.Node.EventType.TOUCH_END,
                        function (e) {
                            t.hide(), e.stopPropagation();
                        },
                        this
                    );
            }),
            (e.prototype.hide = function () {
                d.UIMgr.hide(l.default.AlertUI, !1, !0);
            }),
            (e.prototype.init = function (t) {
                (this.game = t.game),
                    t.cancel ? (this.cancelBtn.active = !0) : (this.cancelBtn.active = !1),
                    t.func ? (this.enterBack = t.func) : (this.enterBack = null),
                    (this.tipsLabel.string = t.text);
            }),
            (e.prototype.onShow = function () {
                (this.node.active = !0),
                    (this.childNode.scale = 0),
                    cc
                        .tween(this.childNode)
                        .to(0.3, { scale: 1 })
                        .call(function () { })
                        .start();
            }),
            (e.prototype.onEnable = function () {
                p.default.showBanner()
                // , p.default.showShareBtn(1);
            }),
            (e.prototype.onDisable = function () {
                p.default.isTT() && p.default.hideBanner(), p.default.hideShareBtn();
            }),
            (e.prototype.start = function () { }),
            s([a(cc.Node)], e.prototype, "childNode", void 0),
            s([a(cc.Node)], e.prototype, "enterBtn", void 0),
            s([a(cc.Node)], e.prototype, "cancelBtn", void 0),
            s([a(cc.Label)], e.prototype, "tipsLabel", void 0),
            s([c], e)
        );
    })(u.default);
o.default = h;
